import request from '@/utils/request'
import { oldVeiBanHost, apiHost } from './config'

// 获取流程详情
export function getApproveDetail(data) {
  return request({
    url: `${oldVeiBanHost}/approve/model/detailed`,
    method: 'post',
    data
  })
}

export function getApproveLinks(data) {
  return request({
    url: `${oldVeiBanHost}/approval/instance/links`,
    method: 'post',
    data
  })
}

export function addApprove(data) {
  return request({
    url: `${oldVeiBanHost}/approval/instance/add`,
    method: 'post',
    data
  })
}

export function getOldMemberList(data) {
  return request({
    url: `${oldVeiBanHost}/office/getAddressBook`,
    method: 'post',
    data
  })
}

// approval-process​/getKitId
export function getApproveModelId(data) {
  return request({
    // eslint-disable-next-line no-irregular-whitespace
    url: `${apiHost}/approval-process/getKitId`,
    method: 'post',
    data
  })
}
// /approval-process/detail
export function getApproveDetailById(data) {
  return request({
    // eslint-disable-next-line no-irregular-whitespace
    url: `${apiHost}/approval-process/detail`,
    method: 'post',
    data
  })
}

// /approval-process/save
export function addApproveSuccess(data) {
  return request({
    // eslint-disable-next-line no-irregular-whitespace
    url: `${apiHost}/approval-process/save`,
    method: 'post',
    data
  })
}
